class Admin::PageMenuOptionsController < AdminController
  
  
  def index
    @page_menu_options = PageMenuOption.all
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @page_menu_options }
    end
  end
  

  def show
    @page_menu_option= PageMenuOption.find(params[:id])
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @page_menu_option }
    end
    
    
  end
  
  def new
    @page_menu_option = PageMenuOption.new  
  end
  
  def create
    @page_menu_option = PageMenuOption.new(params[:page_menu_option]) 
    if @page_menu_option.save
      flash_notice(:page_menu_option_created)
      redirect_to admin_page_menu_options_url
    else
      render :action=>:new
    end
  end
  
  def destroy
    @page_menu_option = PageMenuOption.find(params[:id])
    @page_menu_option.destroy
    flash_notice(:page_menu_option_removed)
    respond_to do |format|
      format.html { redirect_to(admin_page_menu_options_url) }
      format.xml  { head :ok }
    end
  end
  
  def edit
    @page_menu_option = PageMenuOption.find(params[:id])
  end
  
  
  def update
    
    @page_menu_option = PageMenuOption.find(params[:id])
    respond_to do |format|
      if @page_menu_option.update_attributes(params[:page_menu_option])
        flash_notice(:page_menu_option_updated)
        format.html { redirect_to admin_page_menu_option_url(@page_menu_option) }
        format.xml  { head :ok }
      else
        flash_error(:page_menu_option_not_updated)
        format.html { render :action => "edit" }
        format.xml  { render :xml => @page_menu_option.errors, :status => :unprocessable_entity }
      end
    end
    
  end
end
